/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * Project Name: lmrp-android app
 * Create Time: 16-2-16 下午6:31
 */

package com.lenovo.mso2o.conf;

import android.os.Build;

import com.lenovo.mso2o.BuildConfig;

/**
 * Created by hippo on 9/29/15.
 */
public final class MSConstants {
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final String DATE_FORMAT_SHORT = "yyyy-MM-dd HH:mm";
    public static final int SDK = Build.VERSION.SDK_INT;
    public static final String REFRESH_TOKEN_TIME = "update_token_time_millis";
    public static final String ACCESS_TOKEN = "oauth2_access_token";
    public static final String REFRESH_TOKEN = "oauth2_refresh_token_mvs";
    // 一个星期未登录提示重新输入密码
    public static final long AUTHTOKEN_INVALIDE_TIME = 1000 * 60 * 60 * 24 * 7;
    //七牛云有两个key:
    //AK:a6s7Kuyi69zKVkmjQJoB1GuQs3cdUJJfd50mXvn5
    //SK:iws441ChOQtXd5x_6KbJURhxmuUo2aAbgO2NxyTv
    public static final String QINIU_KEY = "key";
    public static final int PAGE_SIZE = 10;
    public static final String GETUI_CID = "getui";
    public static final double RADIS_MIN_SIGN = 1000;
    public static final String SEARCH_HISTORY = "search_history";
    public static final String ACCOUNT_SIGNED = "account_last_logined_name";
    public static final String ACCOUNT_USERNAME = "account_user_name";
    public static final String ACCOUNT_PASSWORD = "account_last_logined_password";
    public static final String KEY_GETUI_CID = "getui_cid";
    public static final String KEY_GETUI_INITED = "getui_inited";
    public static final String LOGIN_NOT_FIRST_TIME = "login_first_time";
    public static final String STEP_RESULT_DATA = "step_result_return";
    public static final String IS_WIFI_POST_UPLOAD = "is_wifi_post_upload";
    public static final String AUDIO_PATH = "audio_path";
    //默认文件暂存7
    public static final long FILE_LIVE_TIME = 7*24 * 3600 * 1000;
    public static final long UPLOAD_FAIL_DURATION = 60 * 1000;
    public static final Integer UPLOAD_FAIL_MAXTIME = 10;
    //默认显示50千米的范围
    public static final Integer MIN_RADIS_AREA = 50*1000;
    public static final String KEY_UPLOAD_MODE_WIFI_ONLY = "upload_mode_in_wifi_only";
    public static final String KEY_MSG_NOTIFY = "key_message_notify";
    //列表刷新最小间隔2s
    public static final long REFRESH_DURATION = 2;

    public static final class LIMITS {
        public static final int IMAGE_UPLOAD_MAX_KB = 400;
        public static final int IMAGE_UPLOAD_MAX_HEIGHT = 800;
        public static final int IMAGE_UPLOAD_MAX_WIDTH = 600;
    }

    /**
     * 保存Fragment类型的常量
     */
    public static final class FragmentType {

        public static final String FRAGMENT_ORDERTYPE = "oder_type";
        public static final int FRAGMENT_GRABORDERS = 0;
        public static final int FRAGMENT_RECEIVEORDERS = 1;
        public static final int FRAGMENT_ACTIVORDERS = 2;
        public static final int FRAGMENT_HISTORYORDERS = 4;

        public static final int DIALOG_CHOICE_FRAGMENT = 0x010;
        public static final int DIALOG_TIME_FRAGMENT = 0x011;
        public static final int DIALOG_TALK_FRAGMENT = 0x012;
        public static final int DIALOG_MORE_FRAGMENT = 0x013;
        public static final int DIALOG_SEARCH_FRAGMENT = 0x014;
        public static final int DIALOG_LOCATION_CHOICE_FRAGMENT = 0x15;
        public static final int DIALOG_SEARCH_FRAGMENT_MS = 0x016;
    }

    public static final class ListParamConstants {
        public static final int FIRST_PAGE = 1;
        public static final String ListType = "status";
        public static final String billStatus = "billStatus";
        public static final String billLevel = "emergencyLevel";
        public static final String projectId = "projectId";
        public static final String orderBy = "orderBy";
        public static final String keyWord = "keyword";
        public static final String startTime = "startTime";
        public static final String endTime = "endTime";
        public static final String mark = "mark";
        public static final String page = "page";
        public static final String pageSize = "limit";

        //参数类型
        public static final int listType_grab = 0;
        public static final int listType_receive = 1;
        public static final int listType_live = 2;
        public static final int listType_history = 4;

        //排序条件类型
        public static final String orderBy_default = "0";
        public static final String orderBy_distance = "1";
        public static final String orderBy_respond = "2";
        public static final String orderBy_repair = "3";

        public static final int page_default = 1;
        public static final int pageSize_default = 10;
        public static final String[] LEVEL_ORDER = {"high", "normal", "low"};


    }

    /**
     * 保存sharedPreference及sqlite常量名
     *
     * @author ltxxx
     */
    public static final class DataConstants {
        public static final String DB_NAME = "mso2o.db";
        public static final String DATA_DIR = "mso2o";
    }

    /**
     * 所有接口常量
     */
    public static final class APIConstants {
        public static final String FAST_BILLING_URL = APIConstants.APISERVER_ADDRESS + "tickets/inspectionTicket";
        public static final String ORDER_DETAIL_URL = APIConstants.APISERVER_ADDRESS + "tickets/%s/detailpage";
        public static final String ORDER_ACTIVITI = APIConstants.APISERVER_ADDRESS + "tickets/%s/%s/activepage";
        public static final String ORDER_BACK = APIConstants.APISERVER_ADDRESS + "tickets/%s/backOrder";
        public static final String INSPECTION_ORDER_DETAIL_URL = APIConstants.APISERVER_ADDRESS + "tickets/%s/inspectiondetailpage";
        public static final String CLOSED_ORDER_DETAIL_URL = APIConstants.APISERVER_ADDRESS + "tickets/%s/closeddetailpage";

        public static final String CLIENT_ID = "mvs";
        public static final String CLIENT_SECRET = "2YotnFZFEjr1zCsicMWpAA";

        //	/**
        //	 * 正式地址 生产发到友盟，和蒲公英
        //	 */
        //public static final String APISERVER_ADDRESS_STATIC = "http://e-support.mspcloud.cn/app/" + BuildConfig.API_VERSION;
        /**
         * 测试地址
         */
        //qa环境, umeng.com sdc qa的发到群里
        //public static final String APISERVER_ADDRESS_STATIC = "http://te-support.mspcloud.cn/app/" + BuildConfig.API_VERSION;

        //开发环境, qq群
        public static final String APISERVER_ADDRESS_STATIC = "http://10.99.106.30/app/" + BuildConfig.API_VERSION;
        public static final String APISERVER_ADDRESS = APISERVER_ADDRESS_STATIC  + "/" + BuildConfig.ITSMCODE + "/";
        public static final String APISERVER_ADDRESS_STATIC_IMAGE = APISERVER_ADDRESS_STATIC  + "/image/";
        public static final String APISERVER_ABOUT = APISERVER_ADDRESS + "about";

        //public static final String APISERVER_ADDRESS = "http://10.103.234.200:8080/";
        //public static final String APISERVER_ADDRESS = "http://124.127.255.6/";
        //public static final String APISERVER_ADDRESS = "http://10.99.107.29/";

        public static final String HIBRID_SERVER_ADDRESS = "http://123.57.223.29/";
        public static final String FEED_BACK_URL = "";
        /**
         * 短信测试地址,测试用的，已经不用了
         * public static final String message_Address = "http://222.73.117.158:80";
         */
    }

    public class OtherConstance{
        public static final int NOTIFICATION_FULL = 10;
        public static final int NOTIFICATION_EMPTY = 0;
    }

    public class UserInfoConstance {
        public static final String USER_ID = "user_Id";
        public static final String USER_CREATE_USER = "user_createUser";
        public static final String USER_CREATE_TIME = "user_createTime";
        public static final String USER_UPDATE_TIME = "user_updateTime";
        public static final String USER_UPDATE_USER = "user_updateUser";
        public static final String USER_ACCOUNT = "user_account";
        public static final String USER_ACCOUNT_MOBILE = "user_accountMobile";
        public static final String USER_ACCOUNT_EMAIL = "user_accountEmail";
        public static final String USER_PASSWORD = "user_password";
        public static final String USER_NAME = "user_Name";
        public static final String USER_IP = "user_Ip";
        public static final String USER_LASTLOGIN_TIME = "user_lastLoginTime";
        public static final String USER_CONFIG = "user_appConfigJson";
        public static final String USER_DELETE = "user_delete";
        public static final String USER_CODE = "user_code";
        public static final String USER_ENGINEER_ID = "user_engineerid";
        public static final String USER_USER_ENGINEER_NAME = "user_engineeridname";
        public static final String USER_STATUS = "user_status";
        public static final String USER_PHONE = "user_phone";
        public static final String USER_EMAIL = "user_email";
    }

}
